﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ras2ClassLib;

namespace Ras2Form
{
    public partial class PerformerDlg : Form
    {
        private Performer m_performer;
        private bool m_bNewPerformer = false;

        public bool NewPerformer
        {
            get { return m_bNewPerformer; }
            set { m_bNewPerformer = value; }
        }


        public Performer Performer
        {
            get
            {
                m_performer.Name        = m_txtName.Text;
                m_performer.Description = m_txtDescription.Text;
                m_performer.Image       = m_txtImagePath.Text;
                m_performer.Url         = m_txtURL.Text;
                return m_performer;
            }
            set
            {
                m_performer           = value;
                m_txtName.Text        = m_performer.Name;
                m_txtDescription.Text = m_performer.Description;
                m_txtImagePath.Text   = m_performer.Image;
                m_txtURL.Text         = m_performer.Url;
                if (NewPerformer)
                    m_btnOK.Text = "Nýskrá";
                else
                    m_btnOK.Text = "Í lagi";
            }
        }

        public PerformerDlg()
        {
            InitializeComponent();
        }

        private void OnLoad(object sender, EventArgs e)
        {
            CenterToParent();
        }
    }
}
